import ray

ray.init(address='ray://192.168.10.99:10001', namespace='fruit')


@ray.remote
class Actor:

    def __init__(self):
        self.i = 0

    def get(self):
        return self.i

    def incr(self, value):
        self.i += value
        return self.i


# driver_2.py
# This fails because "orange" was defined in the "colors" namespace.
# print(ray.get_actor("orange"))
# You can also specify the namespace explicitly.

obj_ref = ray.get_actor(
    'orange', namespace='37e41f26-548f-4653-828f-bd6be7c09f5e')
print(obj_ref)
# print(ray.get(obj_ref))
# obj_ref.incr.remote(1)
print(ray.get(obj_ref.get.remote()))

ray.kill(obj_ref)
